home *** CD-ROM | disk | FTP | other *** search
- * clipwage.PRG
- SELE 2
- USE CLIPstru.str
- sele 1
- use clipwage
- go bott
- totrecs = recno()
- clear
- sele 2
- SET COLO TO 7/0,R/W
- @ 1,0 SAY "╔══════════════════════════════════════════════════════════════════════════════╗"
- @ 2,0 SAY "║"
- Set Color To w+/r, R/W
- @ 2,1 SAY " C L I P P E R dBASE III True compiler "
- SET COLO TO 7/0,R/W
- @ 2,79 SAY "║"
- @ 3,0 SAY "║"
- Set Color To w+/r, R/W
- @ 3,1 SAY " "
- SET COLO TO 7/0,R/W
- @ 3,79 SAY "║"
- @ 4,0 SAY "║"
- Set Color To w+/r, R/W
- @ 4,1 SAY " Demonstration of INDEX CREATION on a database of " + str(totrecs,3,0) + " records "
- SET COLO TO 7/0,R/W
- @ 4,79 SAY "║"
- @ 5,0 SAY "║"
- Set Color To w+/r, R/W
- @ 5,1 SAY " USING CLIPPER'S OWN INDEXING ALGORITHM "
- SET COLO TO 7/0,R/W
- @ 5,79 SAY "║"
- @ 6,0 SAY "╚══════════════════════════════════════════════════════════════════════════════╝"
- SET COLO TO 7+/0,R/W
- @ 8,10 SAY "┌────────────────────────┐"
- @ 9,10 SAY "│"
- @ 9,35 say "│"
- @ 10,10 say "│"
- @ 10,35 say "│"
- @ 11,10 say "│"
- @ 11,35 say "│"
- @ 12,10 say "│"
- @ 12,35 say "│"
- @ 13,10 say "│"
- @ 13,35 say "│"
- @ 14,10 say "│"
- @ 14,35 say "│"
- @ 15,10 say "│"
- @ 15,35 say "│"
- @ 16,10 say "│"
- @ 16,35 say "│"
- @ 17,10 say "│"
- @ 17,35 say "│"
- @ 18,10 say "│"
- @ 18,35 say "│"
- @ 19,10 say "│"
- @ 19,35 say "│"
- @ 20,10 SAY "└────────────────────────┘"
-
- x = 12
- *
- * print out all fields in the structure extended
- *
- SET COLO TO 7+/0,7+/0
- @ 9,12 SAY 'Fields in Structure :'
- @ 10,12 SAY '=================== '
- SET COLO TO R/0,R+/0
- do while .not. eof()
- @ x,15 say str(x-11,2,0) + ' ' + field_name
- x = x + 1
- skip
- enddo
- SET COLO TO 7+/0,7+/0
- @ 12,45 SAY "┌─────────────────────────┐"
- @ 13,45 say "│ Enter the number of │"
- @ 14,45 say "│ the field you wish │"
- @ 15,45 say "│ to create an index for │"
- @ 16,45 say "│ --> │"
- @ 17,45 SAY "└─────────────────────────┘"
- sel = 0
- SET COLO TO w+/r,w+/r
- @ 16,61 get sel pict "9"
- read
- clear gets
- sele 2
- do case
- case sel = 1
- goto 1
- fname = field_name
- FTYPE = FNAME
- FCLASS = FIELD_TYPE
- case sel = 2
- goto 2
- fname = field_name
- FTYPE = FNAME
- FCLASS = FIELD_TYPE
- case sel = 3
- goto 3
- fname = field_name
- FTYPE = FNAME
- FCLASS = FIELD_TYPE
- case sel = 4
- goto 4
- fname = field_name
- FTYPE = FNAME
- FCLASS = FIELD_TYPE
- case sel = 5
- goto 5
- fname = field_name
- FTYPE = FNAME
- FCLASS = FIELD_TYPE
- case sel = 6
- goto 6
- fname = field_name
- FTYPE = FNAME
- FCLASS = FIELD_TYPE
- case sel = 7
- goto 7
- fname = field_name
- FTYPE = FNAME
- FCLASS = FIELD_TYPE
- case sel = 8
- goto 8
- fname = field_name
- FTYPE = FNAME
- FCLASS = FIELD_TYPE
- endcase
- SET COLO TO 7/0,7/0
- X = 12
- DO WHILE X < 18
- @ X,45 SAY " "
- X = X + 1
- ENDDO
- SET COLO TO /w,/w
- @ 12,45 SAY "┌─────────────────────────┐"
- @ 13,45 say "│ Now creating an index │"
- @ 14,45 say "│ on field │"
- @ 14,57 say fname
- @ 15,45 say "│ in correct format for │"
- @ 16,45 say "│ use by CLIPPER │"
- @ 17,45 SAY "└─────────────────────────┘"
- if file("userndx.ntx")
- dele file userndx.ntx)
- endif
- if file("userndx.ndx")
- dele file userndx.ndx
- endif
- SELE 1
- if fclass = 'C'
- index on upper(&fname) to userndx
- else
- index on &fname to userndx
- endif
- Set Color To w+/r,w/r
- @ 12,45 SAY "┌─────────────────────────┐"
- @ 13,45 say "│ Index is completed │"
- @ 14,45 say "│ on field │"
- @ 14,57 say fname
- @ 15,45 say "│ Do you want to examine │"
- @ 16,45 say "│ the data using it ? │"
- @ 17,45 say "│ --> │"
- @ 18,45 SAY "└─────────────────────────┘"
- view = .t.
- @ 17,60 get view
- read
- clear gets
- set color to 7/0,7/0
- if view
- do clipview
- ELSE
- return
- endif